package com.megalith.controller;

import com.megalith.entities.Order;
import com.megalith.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.List;

/**
 * @Description TODO
 * @Author lfp
 * @Date 2021/4/12 14:45
 * @Version 1.0
 */
@Api(tags = "订单测试接口")
@RestController
@RequestMapping("/order")
public class OrderTestController {

    @ApiOperation(value = "获取订单列表")
    @GetMapping("/list")
    public Result<List<Order>> getOrderList(){
        Order order = new Order();
        order.setOrderId(202104086623545L);
        order.setPrivice(BigDecimal.valueOf(20));
        order.setStatus(0);
        order.setUserId("10001");

        return Result.ok(Arrays.asList(order));
    }

    @ApiOperation(value = "测试1")
    @GetMapping("/test1")
    public void test1(){}

    @ApiOperation(value = "测试2")
    @PostMapping("/test2")
    public void test2(){}
}